from exts import db
from apps.basic.models import Address
from apps.common.base_model import BaseModel

class Member(BaseModel):
    __tablename__="t_member"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(50), comment='用户名', nullable=False)
    password=db.Column(db.String(50),comment='密码',nullable=False)
    mobile=db.Column(db.String(50),comment='手机号码')
    sex = db.Column(db.Integer)
    birthday = db.Column(db.Date)
    email = db.Column(db.String(50), comment="邮箱")
    user_img=db.Column(db.String(50),comment="用户头像")
    level=db.Column(db.Integer,default=0)
    status=db.Column(db.Integer,default=0)
    address=db.relationship(Address,backref="back_user",lazy=True)

    def __repr__(self):
        return self.username
